/*! 
 * Header file for a collision sphere.
 *
 * \author Devis Rossini
 * \date 19 March 2012
 */
#ifndef PHXCOLLISIONPLANE_H_INCLUDE_GUARD
#define PHXCOLLISIONPLANE_H_INCLUDE_GUARD

#include "PhxCore.h"
#include "PhxCollisionPrimitive.h"
#include "PhxCollisionPrimitiveDescriptor.h"

namespace phx 
{	
	/*!
	 * Plane descriptor.
	 */
	struct CollisionPlaneDescriptor : public CollisionPrimitiveDescriptor
	{
		/*!
		 * Constructor.
		 */
		CollisionPlaneDescriptor() 
			: mDirection(Vector3::ZERO), mOffset(0) { }

		/*!
		 * Destructor (virtual).
		 */
		~CollisionPlaneDescriptor() { }

		/*!
		 * Return the shape type.
		 */
		virtual ShapeTypes GetShapeType() const { return PLANE_SHAPE; }

        /*!
         * The plane normal.
         */
		Vector3 mDirection;
		
		/*!
         * The distance of the plane from the origin.
         */
		real mOffset;
	};

	/*!
	 * A plane (infinite) collision geometry.
     */
    class CollisionPlane : public CollisionPrimitive
    {
    public:

		/*!
		 * Constructor.
		 */
		CollisionPlane() { }

		/*!
		 * Constructor (with descriptor).
		 */
		CollisionPlane(const CollisionPlaneDescriptor& desc)
			: CollisionPrimitive(desc), mDirection(desc.mDirection), mOffset(desc.mOffset) { }

		/*!
		 * Destructor (virtual).
		 */
		virtual ~CollisionPlane() { }

		/*!
		 * Return the shape type.
		 */
		virtual inline ShapeTypes GetShapeType() const { return PLANE_SHAPE; }

        /*!
         * The plane normal.
         */
        Vector3 mDirection;

        /*!
         * The distance of the plane from the origin.
         */
        real mOffset;
    };
}

#endif // PHXCOLLISIONPLANE_H_INCLUDE_GUARD